import 'dart:ui';

class SizeFit {
  static double physicalWidth = 0;
  static double physicalHeight = 0;
  static double dpr = 0;
  static double screenWidth = 0;
  static double screenHeight = 0;
  static double rpx = 0;
  static void initSize({double standardSize = 750}) {
    physicalWidth = window.physicalSize.width;
    physicalWidth = window.physicalSize.height;
    dpr = window.devicePixelRatio;

    screenWidth = physicalWidth / dpr;
    screenHeight = physicalHeight / dpr;

    rpx = screenWidth / standardSize;
  }

  static double setRpx(double size) {
    return size * rpx;
  }

  static double setPx(double size) {
    return size * rpx / 2 ;
  }
}